package com.bcxj.serviceorder.controller;

import com.bcxj.internalcommon.dto.ResponseResult;
import com.bcxj.internalcommon.entity.OrderInfo;
import com.bcxj.serviceorder.mapper.OrderInfoMapper;
import com.bcxj.serviceorder.service.OrderInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: TestController
 * Package: com.bcxj.serviceorder.controller
 * Description:
 *
 * @Author BCXJ
 * @Create 2024/11/17 20:58
 * @Version 1.0
 * @Since 1.0
 */
@Slf4j
@RestController
public class TestController {

    @Autowired
    private OrderInfoService orderInfoService;

    @Autowired
    private OrderInfoMapper orderInfoMapper;

    @GetMapping("/test-real-time-order/{orderId}")
    public ResponseResult testRealTimeOrder(@PathVariable("orderId") String orderId) {
        log.info("orderId:{}", orderId);
        OrderInfo orderInfo = orderInfoMapper.selectById(orderId);
        orderInfoService.dispatchRealTimeOrder(orderInfo);
        return ResponseResult.success();
    }

}
